package com.novel.entiy;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 小说主表
 *
 * @author tanghao
 * @date 2022/4/8
 */
@ApiModel(value = "com-novel-entiy-Novel")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "novel")
public class Novel {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "")
    private Long id;

    /**
     * 标题
     */
    @TableField(value = "title")
    @ApiModelProperty(value = "标题")
    private String title;

    /**
     * 简介
     */
    @TableField(value = "introduction")
    @ApiModelProperty(value = "简介")
    private String introduction;

    /**
     * 作者名称
     */
    @TableField(value = "author_name")
    @ApiModelProperty(value = "作者名称")
    private String authorName;

    /**
     * 作者id
     */
    @TableField(value = "author_id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "作者id")
    private Long authorId;

    /**
     * 阅读数
     */
    @TableField(value = "browse_nums")
    @ApiModelProperty(value = "阅读数")
    private Long browseNums;

    /**
     * 字数
     */
    @TableField(value = "word_nums")
    @ApiModelProperty(value = "字数")
    private Long wordNums;

    /**
     * 订阅数
     */
    @TableField(value = "subscribe_nums")
    @ApiModelProperty(value = "订阅数")
    private Long subscribeNums;

    /**
     * 章节数
     */
    @TableField(value = "chapter_nums")
    @ApiModelProperty(value = "章节数")
    private Integer chapterNums;

    /**
     * 热度
     */
    @TableField(value = "hot_nums")
    @ApiModelProperty(value = "热度")
    private Long hotNums;

    /**
     * 0:连载中 1:已完结 2:审核中 3:审核失败
     */
    @TableField(value = "`status`")
    @ApiModelProperty(value = "0:连载中 1:已完结 2:审核中 3:审核失败")
    private Integer status;

    /**
     * 是否收费
     */
    @TableField(value = "is_charge")
    @ApiModelProperty(value = "从第几章开始 收费 0为不收费")
    private Integer isCharge;

    /**
     * 每章收费金额
     */
    @TableField(value = "charge_amount")
    @ApiModelProperty(value = "每章收费金额")
    private Long chargeAmount;

    /**
     * 评论数
     */
    @TableField(value = "comment_nums")
    @ApiModelProperty(value = "评论数")
    private Long commentNums;

    /**
     * 封面
     */
    @TableField(value = "cover")
    @ApiModelProperty(value = "封面")
    private String cover;

    /**
     * 评分
     */
    @TableField(value = "score")
    @ApiModelProperty(value = "评分")
    private BigDecimal score;

    /**
     * 评分人数
     */
    @TableField(value = "score_nums")
    @ApiModelProperty(value = "评分人数")
    private Integer scoreNums;

    /**
     * 分类id
     */
    @TableField(value = "classify_id")
    @ApiModelProperty(value = "分类id")
    private Integer classifyId;

    /**
     * 分类名称
     */
    @TableField(value = "classify_name")
    @ApiModelProperty(value = "分类名称")
    private String classifyName;

    /**
     * 创建时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date createdTime;

    /**
     * 更新时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;

    /**
     * 删除标识
     */
    @TableLogic
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除标识")
    private Integer deleted;

    public static final String COL_ID = "id";

    public static final String COL_TITLE = "title";

    public static final String COL_INTRODUCTION = "introduction";

    public static final String COL_AUTHOR_NAME = "author_name";

    public static final String COL_AUTHOR_ID = "author_id";

    public static final String COL_BROWSE_NUMS = "browse_nums";

    public static final String COL_WORD_NUMS = "word_nums";

    public static final String COL_SUBSCRIBE_NUMS = "subscribe_nums";

    public static final String COL_CHAPTER_NUMS = "chapter_nums";

    public static final String COL_HOT_NUMS = "hot_nums";

    public static final String COL_STATUS = "status";

    public static final String COL_IS_CHARGE = "is_charge";

    public static final String COL_CHARGE_AMOUNT = "charge_amount";

    public static final String COL_COMMENT_NUMS = "comment_nums";

    public static final String COL_COVER = "cover";

    public static final String COL_SCORE = "score";

    public static final String COL_SCORE_NUMS = "score_nums";

    public static final String COL_CLASSIFY_ID = "classify_id";

    public static final String COL_CLASSIFY_NAME = "classify_name";

    public static final String COL_CREATED_TIME = "created_time";

    public static final String COL_UPDATED_TIME = "updated_time";

    public static final String COL_DELETED = "deleted";
}